package com.globallogic.vacationplanner.web.helper;

import org.apache.log4j.Logger;

import com.globallogic.vacationplanner.transfer.dto.impl.VacationDto;
import com.globallogic.vacationplanner.web.controller.UserBean;
import com.globallogic.vacationplanner.web.controller.VacationBean;

public class VacationBeanHelper {
	private static Logger LOGGER = Logger.getLogger(VacationBeanHelper.class);

	public VacationDto buildVacationDto(VacationBean vacationBean) {
		LOGGER.info("start build VacationDto from vacation backing bean");
		VacationDto vacationDto = new VacationDto();
		UserBean userBean = vacationBean.getUserBean();
		vacationDto.setStartDate(vacationBean.getStartDate());
		vacationDto.setEndDate(vacationBean.getEndDate());
		vacationDto.setDescription(vacationBean.getDescription());
		vacationDto.setLogin(userBean.getLogin());
		LOGGER.info("build VacationDto was success");
		return vacationDto;
	}

};